import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path';
import vueJsx from '@vitejs/plugin-vue-jsx';
// const { VITE_BASE_PATH } = import.meta.env;

// https://vite.dev/config/
export default ({ mode }) => {
  const env = loadEnv(mode, process.cwd(), '')

  return defineConfig({
    base: env.VITE_BASE_PATH,
    resolve: {
      alias: {
        '@': resolve(__dirname, 'src'),
      },
    },
    server: {
      host: "0.0.0.0",
      port: 3000,
      proxy: {
        "/api": {
          changeOrigin: true,
          target: "https://api.ykpz.site",
          // target: "http://127.0.0.1:8000",
        },
      }
    },
    plugins: [vue(), vueJsx()],

  })

}



